package com.charm.businesshub.anko

import android.support.v7.widget.LinearLayoutManager
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import com.charm.businesshub.adapter.NewsListAdapter
import com.charm.businesshub.ui.activity.NewsListActivity
import org.jetbrains.anko.*
import org.jetbrains.anko.recyclerview.v7.recyclerView

/**
 * Created by tools on 2018/1/5.
 */
class NewsListUI(adapter: NewsListAdapter) : AnkoComponent<NewsListActivity> {
    private var mAdapter = adapter

    override fun createView(ui: AnkoContext<NewsListActivity>): View {
        var rootView = ui.linearLayout {
            recyclerView {
                adapter = mAdapter
                layoutManager = LinearLayoutManager(ui.ctx)
            }.lparams {
                width = ViewGroup.LayoutParams.MATCH_PARENT
                height = ViewGroup.LayoutParams.MATCH_PARENT
            }
        }
        return rootView
    }


    fun setData(s: String) {
    }
}